﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AccountBind.aspx.cs" Inherits="ExamAnalysis.Account.AccountBind" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        Select="new (UserName)" TableName="aspnet_Users">
    </asp:LinqDataSource>
<ext:Panel ID="Panel1" runat="server" Width="400" Height="300">
            <LayoutConfig>
                <ext:HBoxLayoutConfig Align="Stretch" Padding="5" />
            </LayoutConfig>
            <Items>
                <ext:GridPanel
                    ID="GridPanel2" 
                    runat="server"
                    MultiSelect="true"
                    Title="学生与老师"
                    Flex="1"
                    Width="400"
                    Margins="0 0 0 3">
                    <Store>
                        <ext:Store ID="Store2" runat="server" >
                            <Model>
                                <ext:Model ID="Model2" runat="server" IDProperty="ID">
                                    <Fields>
                                        <ext:ModelField Name="ID" />
                                        <ext:ModelField Name="Code" />
                                        <ext:ModelField Name="Name" />
                                        <ext:ModelField Name="Type" />
                                        <ext:ModelField Name="Account" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:Column ID="Column4" runat="server" Text="学号/工号" Width="160" DataIndex="Code" Flex="1">
                    </ext:Column>
                            <ext:Column ID="Column5" runat="server" Text="姓名" Width="160" DataIndex="Name" Flex="1">
                    </ext:Column>
                            <ext:Column ID="Column6" runat="server" Text="类型" Width="60" DataIndex="Type" Flex="1">
                    </ext:Column>
                    <ext:Column ID="Column1" runat="server" Text="账号" Width="160" DataIndex="Account" Flex="1">
                    </ext:Column>
                        </Columns>
                    </ColumnModel> 
        <SelectionModel>
           <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" Mode="Single">
                        </ext:RowSelectionModel>
        </SelectionModel>
                </ext:GridPanel>
            </Items>
            <TopBar>
            <ext:Toolbar runat="server">
            <Items>
            <ext:ComboBox ID="ComboBox1" 
            runat="server"
            Width="200"
            Editable="false"
            DisplayField="UserName"
            ValueField="UserName"
            TypeAhead="true" 
            QueryMode="Local"
            ForceSelection="true"
            TriggerAction="All"
            EmptyText="选择一个用户"
            SelectOnFocus="true" MaxWidth="200">                        
            <Store>
                <ext:Store ID="Store1" runat="server" DataSourceID="LinqDataSource1">
                    <Model>
                        <ext:Model ID="Model1" runat="server">
                            <Fields>
                                <ext:ModelField Name="UserName" />
                            </Fields>
                        </ext:Model>
                    </Model>            
                </ext:Store>
            </Store>
            <ListConfig>
                <ItemTpl ID="ItemTpl1" runat="server">
                    <Html>
						<div class="list-item">
							    <h3>{UserName}</h3>
						</div>
				    </Html>    
                </ItemTpl>
            </ListConfig>
        </ext:ComboBox>
            </Items>
            </ext:Toolbar>
            </TopBar>
            <BottomBar>
                <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                       <ext:Button ID="Button1" runat="server" Text="绑定账号"  OnDirectClick="Button2_Click">
                       </ext:Button>
                    </Items>
                </ext:Toolbar>                
            </BottomBar>
        </ext:Panel>
</asp:Content>
